package com.wyg.singleton;

/**
 * @description:
 * @author: WYG
 * @time: 2020/12/29 17:55
 */

public class DCLSingleton {
    private volatile static DCLSingleton singleton;
    private DCLSingleton (){}
    public static DCLSingleton getSingleton() {
        if (singleton == null) {
            synchronized (Singleton.class) {
                if (singleton == null) {
                    singleton = new DCLSingleton();
                }
            }
        }
        return singleton;
    }

    public static void main(String[] args) {
        DCLSingleton singleton = DCLSingleton.getSingleton();
    }
}
